package com.supcon.exchangedata.repository.slave1;


import com.supcon.exchangedata.pojo.entity.oracle.StatistOtherParametersMonth;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yangbin
 * @Date: 2022/03/18/9:36
 * @Description:
 */
public interface SlaveOneStatistOtherParametersMonthRepository extends JpaRepository<StatistOtherParametersMonth, Long> {
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true, value = "select * from STATIST_OTHER_PARAMETERS_MONTH   where MONTH_KEY = ?1 and OBJ_ID is not null and 'TYPE' is not null and MONTH_KEY is not null order by MONTH_KEY desc")
    List<StatistOtherParametersMonth> findAllByCondition(String monthKey);

    List<StatistOtherParametersMonth> findAllByObjIdAndTypeAndInAvgValueIsNotNullOrderByMonthKeyDesc(Long objId,Long type);


}
